<template>
    <div>
        <el-button type="primary" @click="addBtn">新增放映厅</el-button>
        <el-dialog title="收货地址" :visible.sync="dialogFormVisible">
            <el-form :model="RommList" label-width="120px">
                <el-form-item label="影院名称" :label-width="formLabelWidth">
                    <el-input autocomplete="off" style="width: 500px;"></el-input>
                </el-form-item>
                <el-form-item label="影院类型" :label-width="formLabelWidth">
                    <el-select  placeholder="请选择放映厅类型" style="width: 500px;">
                        <el-option v-for="typeItem in typeList" :key="typeItem.id" :label="typeItem.type_name" :value="typeItem.type_name"></el-option>
                    </el-select>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="dialogFormVisible = false">取 消</el-button>
                <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
            </div>
        </el-dialog>
        <el-divider content-position="left">放映厅列表</el-divider>
        <el-table>
            <el-table-column></el-table-column>
        </el-table>
    </div>
</template>

<script>
import httpApi from '@/http/index'
    export default {
        data() {
            return {          
                typeList:[],// 保存放映厅类型
                dialogTableVisible: false,
                dialogFormVisible: false,
                formLabelWidth: '120px',
                RommList:{
                    roomName:'1',
                    type:'',
                },
            }
        },
        mounted () {
            this.cinemaRoom()
        },
        methods: {
            addBtn(){
                this.dialogFormVisible = true
                this.roomType()
            },
            // 放映厅类型
            roomType(){
                httpApi.cinemaRoomApi.queryAllTypes().then(res=>{
                    console.log('加载放映厅类型列表',res);
                    this.typeList = res.data.data
                })
            },
            // 放映厅列表
            cinemaRoom() {
                let id = this.$route.params
                console.log(id)
                httpApi.cinemaApi.queryCnemaRoom(id).then(res=>{
                    console.log(res)
                    this.RommList = res.data.data
                })
            }
        },
    }
</script>

<style lang="scss" scoped>

</style>